Ext.ns('StaffServer.comp');



StaffServer.comp.toCombV = function(object) {
	var result = [];
	if (object) {
		for ( var k in object) {
			if (typeof (k) != undefined && !Ext.isFunction(object[k])) {
				var s;
				if (k == 'true') {
					s = [ true, object[k] ];
				} else if (k == 'false') {
					s = [ false, object[k] ];
				} else {
					s = [ k, object[k] ];
				}
				result.push(s);
			}
		}
	}
	return result;
}


Ext.define('StaffServer.comp.CommomComboBox',
		{
			extend : 'Ext.form.ComboBox',
			alias : [ 'widget.CommomComboBox' ],
			fieldLabel : '下拉',

			displayField : 'text',
			valueField : 'value',
			triggerAction : 'all',
			data : 'status.generic',
			emptyText : '请选择',
			queryMode : 'local',
			constructor : function(config) {
				Ext.apply(this, config);
				var me = this;
				this.store = new Ext.data.JsonStore({
					fields : [ 'value', 'text' ],
					data : StaffServer.comp.toCombV(StaffServer.data[me.data])
				})
				StaffServer.comp.CommomComboBox.superclass.constructor
						.call(this);
			}
		});

Ext.define('StaffServer.comp.DateColumnRender', {
	extend : 'Ext.grid.column.Date',
	alias : 'widget.SdateRender',
	format:'Y-m-d'
});

Ext.define('StaffServer.comp.DateFieldRender', {
	extend : 'Ext.form.field.Date',
	alias : 'widget.SdateField',
    format: 'Y-m-d',
    submitFormat: 'Ymd'
});
